<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>http://javascript.ruanyifeng.com/stdlib/wrapper.html</title>
</head>
<body>
<script type="text/javascript">
    console.log(Boolean(undefined));// false
    console.log(Boolean(null));// false
    console.log(Boolean(0));// false
    console.log(Boolean(''));// false
    console.log(Boolean(NaN));// false

    console.log(Boolean(1));// true
    console.log(Boolean('false')); // true
    console.log(Boolean([])); // true
    console.log(Boolean({})); // true
    console.log(Boolean(function () {
    })); // true
    console.log(Boolean(/foo/)); // true

    console.log(!!undefined);// false
    console.log(!!null);// false
    console.log(!!0);// false
    console.log(!!'');// false
    console.log(!!NaN);// false
    console.log(!!1);// true
    console.log(!!'false'); // true
    console.log(!![]); // true
    console.log(!!{}); // true
    console.log(!!function () {
    }); // true
    console.log(!!/foo/); // true


    console.log(new Boolean(false) === true);
    if (new Boolean(null)){
        console.log('false')
    }

</script>
</body>
</html>